},
_windowsRestacked: function() {
- let windows = global.get_window_actors();
+ let windows = Main.getWindowActorsForWorkspace(global.screen.get_active_workspace_index());
let primary = global.get_primary_monitor();
// The chrome layer should be visible unless there is a window
overview.hide();
}
+function isWindowActorDisplayedOnWorkspace(win, workspaceIndex) {
+ return win.get_workspace() == workspaceIndex ||
+ (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
+}
+
+function getWindowActorsForWorkspace(workspaceIndex) {
+ return global.get_window_actors().filter(function (win) {
+ return isWindowActorDisplayedOnWorkspace(win, workspaceIndex);
+ });
+}
+
// metacity-clutter currently uses the same prefs as plain metacity,
// which probably means we'll be starting out with multiple workspaces;
// remove any unused ones. (We do this from an idle handler, because
this.actor.height = global.screen_height;
this.scale = 1.0;
- let windows = global.get_window_actors().filter(this._isMyWindow, this);
+ let windows = Main.getWindowActorsForWorkspace(this.metaWorkspace.index());
// Create clones for remaining windows that should be
// visible in the Overview
// Tests if @win belongs to this workspaces
_isMyWindow : function (win) {
- return win.get_workspace() == this.metaWorkspace.index() ||
- (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
+ return Main.isWindowActorDisplayedOnWorkspace(win, this.metaWorkspace.index());
},
// Tests if @win should be shown in the Overview